1. Technical Field
This invention relates to the field of distributed object communications and more particularly to a method for location transparent event handling.
2. Description of the Related Art
In computer programming, the term “event handling” refers to the way in which a computer program processes external and internal occurrences in a computer program. External occurrences can include keystrokes, mouse-clicks and externally sensed events, for example, digital data generated by an A/D converter linked to an external transducer. Conversely, internal occurrences can include internally generated events such as time-out conditions or manually created events. Event handling techniques typically are implemented in event-driven computer programs.
Event-driven computer programming differs from straightforward procedural programming in that in event-driven programming, there is not a linear, unbroken thread of control as is true in a procedural computer program. Instead, an event-driven program is reactive. As such, an event-driven program spends the bulk of its execution time “sleeping”, waiting for an event to occur which requires a response. When an event occurs, an event-driven program “wakes up”, handles the event, and goes back to sleep until the next event occurs.
In the object-oriented programming art, an object that is interested in receiving events is termed an event listener. Correspondingly, an object that generates events, known as an event notifier, maintains a list of the event listeners that are interested in being notified when events occur. The event notifier exposes methods that permit the event listeners to add themselves to this list of interested objects. When the event source generates an event, the event source notifies all the listener objects in the list that the event has occurred.
In the object-oriented programming language Java, an event handling schema can be implemented using a concrete Event class, a concrete Listener class and a concrete Notifier class. In Java, the first step in establishing event handling is to define an event listener for the object from which the event originates. An event listener can be an instance of a concrete Listener class which implements an appropriate listener interface (hereinafter “Listener Object”). A Listener Object can be the application, a container object, or an instance of the concrete Notifier class (hereinafter “Notifier Object”) itself. The role of the Listener Object is to “listen for” and respond to events communicated by the Notifier Object. Notably, the Notifier Object can be the portion of the application which “sleeps” until receiving an instance of the concrete Event class (hereinafter “Event Object”). In particular, an Event Object can contain data necessary to identify and describe the externally or internally occurring event.
In Java, in order to listen for objects of a class Event, the concrete Listener class must implement the Listener interface. Each Listener interface consists of a series of methods which Listener Objects of that type must provide. Each method corresponds to a specific action to be taken in response to receiving a particular event. For example, to listen for mouse generated events such as mouse clicks or mouse movements, a Listener object must implement a mouse-specific Listener interface. Mouse-specific Listener objects that implement a mouse-specific Listener interface should implement the methods mouseclicked( ), mousepressed( ), and mouseReleased( ).
In an event-driven computer program, the Notifier Object can maintain an awareness of all Listener Objects who are “listening” for an Event Object. Responsive to receiving an Event Object, the Notifier Object can notify each Listener Object of the event. Correspondingly, the Listener Object can determine if a response is merited based on the identity of the Event Object. If the Listener Object is programmed to respond to the Event Object, the Listener Object can “handle” the occurrence of the event according to an event handling routine defined in the concrete Listener class.
Object-oriented programming languages like Java recently have been proven effective in the technology space of distributing computing. A primary principle of distributed computing includes the use of distributed objects, in which the distributed object most appropriate for performing a task is used regardless of the location of the distributed object. The concept of distributed objects combines the benefits of object-oriented programming with the benefits of distribution on a computer communications network. Popular software architectures used for implementing object distribution can include Common Object Broker Architecture (CORBA), Enterprise Java Beans (EJB) and Remote Method Invocation (RMI).
Notwithstanding, present techniques in event-driven computer programming are limited to a single address space. In particular, in the Java programming language, the Java event model is confined to a single Java Virtual Machine (JVM). Notably, the Java event model does not include a facility for notifying and receiving events across multiple JVMs distributed about a computer communications network. In fact, the Java model does not include a facility for notifying and receiving events across multiple JVMs distributed in a single computer. However, current techniques in Java-based distributed objects rarely are confined to a single JVM. Thus, there exists a need for location transparent event handling.